<?php

class Index extends MY_Controller {

    function __construct() {
        parent::__construct();
    }
    
    public function index() {
        $article = new Article();
        $testimonial = new Testimonial();
        $banner = new Banner();
        $slide = new Slide();
        $latestNews = new Article();
        
        $article->where_related_category('id', 1)->order_by('date', 'desc')->get();
        $testimonial->get()->all;
        $banner->where('position', 'wide_top_content')->get();
        $slide->get()->all;
        $latestNews->where_related_category('id', 7)->order_by('date', 'desc')->limit(3)->get();

        
        $data['articles'] = $article;
        $data['latestNews'] = $latestNews;
        $data['testimonials'] = $testimonial;
        $data['banner_wide_top_content'] = $banner;
        $data['slides'] = $slide;
        $data['template'] = 'index';
        
        $this->load->view('template', $data); 	
    }
}
/* End of file index.php */
/* Location: ./application/controllers/index.php */